package com.mingqijia.gassafety.console.controller;

import com.gap.basic.base.CommonResponse;
import com.mingqijia.gassafety.db.entity.OperateRecord;
import com.mingqijia.gassafety.db.entity.vo.OperateTypeVO;
import com.mingqijia.gassafety.shared.utils.commonUtils.PageUtil;
import com.mingqijia.gassafety.webserver.request.OperateRecordRequest;
import com.mingqijia.gassafety.webserver.response.OperateRecordResponse;
import com.mingqijia.gassafety.webserver.response.OperationLogResponse;
import com.mingqijia.gassafety.webserver.service.OperateRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Api("操作日志")
    @RequestMapping("/business/v1/operation/record")
public class OperateRecordController {

    @Autowired
    private OperateRecordService recordService;

    @ApiOperation("操作列表")
    @PostMapping("/list")
    public CommonResponse<Object> getList(@RequestBody OperateRecordRequest request){

        PageUtil<OperateRecordResponse> list = recordService.getList(request);

        return CommonResponse.success(list);
    }

    @ApiOperation("操作类型")
    @PostMapping("/operateType")
    public CommonResponse<Object> getType(@RequestBody OperateRecordRequest request){

         List<OperateTypeVO> list = recordService.getType(request);

        return CommonResponse.success(list);
    }
}
